<template>
  <div id="app">
    <router-view/>
    <toast/>
  </div>
</template>

<script>
import AppEvents from './event'
import Toast from '@/components/Toast'
export default {
  name: 'App',
  components: { Toast },
  data: () => ({
    snackbar: {
      show: false,
      text: '',
      color: ''
    }
  }),
  created () {
    AppEvents.forEach(item => {
      this.$on(item.name, item.callback)
    })
    window.getApp = this
  }
}
</script>
